var status = -1;

function start() {
    action(1, 0, 0)
}

function action(d, b, a) {
    status++;
    var c = cm.getJob();
    if (c == 2005 || c == 2500 || c == 2510 || c == 2511 || c == 2512) {
        action1(d, b, a)
    } else {
        cm.dispose()
    }
}

function action1(d, c, b) {
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.curNodeEventEnd(true);
            cm.eventSKill(0);
            cm.setInGameDirectionMode(true, true, true);
            cm.inGameDirectionEvent_MoveAction(0);
            cm.sendNormalTalk("虽然这让我轻而易举地进入了，可是花巨金制成的物品居然成了这副样子，看来幻影那家伙可要愤怒了。不过看这里的宝物还是堆积如山，应该不是有人入侵。可以说是运气不错吧。", 3, 0, false, true)
        } else {
            if (status === a++) {
                cm.curNodeEventEnd(true);
                cm.inGameDirectionEvent_MoveAction(2);
                cm.inGameDirectionEvent_AskAnswerTime(1500)
            } else {
                if (status === a++) {
                    cm.inGameDirectionEvent_MoveAction(0);
                    cm.sendNormalTalk("女皇阿莉亚…………这就是幻影绝对不让外人进入这里的理由吧。虽然对其他人来说已经是数百年前的事了，但对于幻影来说就好像发生在昨天一样。", 3, 0, false, true)
                } else {
                    if (status === a++) {
                        cm.inGameDirectionEvent_AskAnswerTime(500)
                    } else {
                        if (status === a++) {
                            cm.npc_ChangeController(2159439, "oid=240779431", -567, 118, 5, -617, -517, 0, false, 0, false);
                            cm.npc_SetSpecialAction("oid=240779431", "summon", 0, 0);
                            cm.inGameDirectionEvent_AskAnswerTime(500)
                        } else {
                            if (status === a++) {
                                cm.sendNormalTalk("怎么回事？守护者坏掉还不算，又有入侵者？啊，这让怪盗幻影的面子往哪儿放啊？看来我得好好招待一下客人才行。", 1, 2159439, false, true)
                            } else {
                                if (status === a++) {
                                    cm.spawnMobLimit(9300872, 1, -567, 120, 100);
                                    cm.spawnMobLimit(9300872, 1, -567, 120, 100);
                                    cm.npc_LeaveField("oid=240779431");
                                    cm.npc_LeaveField("oid=240779431");
                                    cm.updateInfoQuest(38054, "");
                                    cm.forceStartQuest(38054, "");
                                    cm.eventSKill(0);
                                    cm.setInGameDirectionMode(false, true, false);
                                    cm.forceStartQuest(38054, "001");
                                    cm.gainExp(30000);
                                    cm.forceCompleteQuest(38054);
                                    cm.dispose();
                                    cm.warp(915020202, 0, false)
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

function action2(d, c, b) {
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {}
    }
};